Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOExpressionArray

Inherits From:	NSMutableArray : NSArray : NSObject

Conforms To:	NSCopying

Declared In:	eoaccess/EOExpressionArray.h

Class Description

EOExpressionArray is a subclass of NSMutableArray that composes an expression value from the expression values of its elements when you send it an expressionValueForContext: message (see the EOExpression informal protocol specification). An expression value is a representation of an object suitable for inclusion in a SQL statement. This class is used internally by the Framework; you should never need to create or use one yourself.

In addition to its array elements, an EOExpressionArray keeps a trio of strings that it uses to format its expression value in certain cases. It has a prefix that precedes the elements' expression values, an infix that gets inserted between each pair of expression values, and a suffix that's appended to the elements' expression values.

If you provide a context when you ask for an EOExpressionArray's expression value and its first element is an EORelationship, its elements are assumed to be a data path ending in an attribute, and the expression value depends on how the context handles that data path. If you don't provide a context, however, the EOExpressionArray builds a string with the expression values of its elements and its prefix, infix, and suffix.

Suppose an expression array contains the following items:

array elements: EOAttributes named ªlastNameº, ªfirstNameº, and ªaddressº
prefix: ª(º
infix: ª, º
suffix: ª)º

The expression value of this EOExpressionArray is ª(lastName, firstName, address)º.

Instance Variables

None declared in this class.

Adopted Protocols

NSCopying	- copy
- copyWithZone:

Method Types

Creating instances	- initWithPrefix:infix:suffix:

Setting the components	- setPrefix:
- prefix
- setInfix:
- infix
- setSuffix:
- suffix

Checking contents	- referencesObject:

Instance Methods

expressionValueForContext:

- (NSString *)expressionValueForContext:(id <EOExpressionContext>)context

If context is non-nil and the receiver's first element is an EORelationship, sends the context an expressionValueForAttributePath: message with self as the argument and returns the resulting expression value; this allows the elements to be property aliased by the context. Otherwise, returns a string with the prefix and suffix on either end, and with the expression values of the receiver's elements between, each separated from the others by the infix string. See the class description for an example.

Returns nil if the receiver is empty.

infix

- (NSString *)infix

Returns the receiver's infix string.

See also:  - prefix, - suffix

initWithPrefix:infix:suffix:

- initWithPrefix:(NSString *)prefix
infix:(NSString *)infix
suffix:(NSString *)suffix

Initializes a newly allocated EOExpressionArray to contain no objects and to use the given prefix, infix, and suffix. This is the designated initializer for the EOExpressionArray class. Returns self.

prefix

- (NSString *)prefix

Returns the receiver's prefix string.

See also:  - infix, - suffix

referencesObject:

- (BOOL)referencesObject:anEO

Returns YES if the receiver contains anEO or if any EOExpressionArray contained by the receiver contains anEO, NO otherwise. Pointer equality, not isEqual:, is used to compare objects.

This method is used by the modeling objects for consistency checking. You should never call this method yourself.

setInfix:

- (void)setInfix:(NSString *)aString

Sets the receiver's infix string to aString.

See also:  - setPrefix:, - setSuffix:

setPrefix:

- (void)setPrefix:(NSString *)aString

Sets the receiver's prefix string to aString.

See also:  - setInfix:, - setSuffix:

setSuffix:

- (void)setSuffix:(NSString *)aString

Sets the receiver's suffix string to aString.

See also:  - setPrefix:, - setInfix:

suffix

- (NSString *)suffix

Returns the receiver's suffix string.

See also:  - prefix, - infix